package cn.edu.cqu.fredyvia.forum.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.util.Date;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author fredyvia
 * @since 2021-07-10
 */
@Data
@TableName("comment_thumb")
public class CommentThumb extends Model<CommentThumb> {

    private static final long serialVersionUID = 1L;

    public CommentThumb(Integer userId,Integer commentId){
        this.userId=userId;
        this.commentId=commentId;
    }

    public CommentThumb(){
    }

    /**
     * 点赞人的id
     */
    @TableId("user_id")
    private Integer userId;
    /**
     * 点赞的话题id
     */
    @TableField("comment_id")
    private Integer commentId;
    /**
     * 点赞时间
     */
    @TableField("create_datetime")
    private Date createDatetime;

    @Override
    public Serializable pkVal() {
        return this.userId;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
